<?php
session_start();//启动session
$username = 'admin';
$password = '123456';
if($_POST['username']==$username && $_POST['password']==$password){
    echo "登陆成功！";
    $_SESSION['username']=$username;
    if ($_POST['7days']=='yes'){
        setcookie('username','$username',time()+60*60*24*7);
    }
    header('location:index.php');
}else{
    echo "账号/密码错误！";
    echo "<a href='test.html'>重新登录</a>";
}
